<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>支付成功</title>
  <style>
    div {
      width: 200px;
      margin: 200px auto;
    }

    button {
      width: 80px;
      height: 40px;
      margin: 20px;
    }
  </style>
</head>

<body>
  <div>
    <p>恭喜你支付成功</p>
    <p><span class="jumpTo">5</span>秒后通往博客</p>
    <p><button class="toBlog">立即到达</button></p>
  </div>

  <script>
    // 加载页面时，触发一个定时器，5s后返回
    onload = function () {
      let seconds = 5;
      let timer = setInterval(() => {
        seconds--;
        document.querySelector('.jumpTo').innerHTML = seconds;
        if (seconds == 0) {
          clearInterval(timer)
          location.href = 'https://zhushenxiu.site'
        }
      }, 1000);
      // 立刻跳转
      document.querySelector('.toBlog').onclick = function () {
        location.href = 'https://zhushenxiu.site'
      }
    }
  </script>
</body>

</html>